package com.db.entity;

import java.sql.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.stereotype.Repository;

@Repository
@Entity
@Table(name = "M_WORKING_HOUR_RECORD")
public class WorkingHoursRecord {
	@Id
	@Column(name = "WORKING_HOURS_UUID")
	@GenericGenerator(name="systemUUID",strategy="uuid")
	@GeneratedValue(generator="systemUUID")
	private String uuid;
	
	private int hours;
	private Date submitDate;
	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "recordId")
	private User user;
	//private Project project;

	
	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public int getHours() {
		return hours;
	}

	public void setHours(int hours) {
		this.hours = hours;
	}

	public int getValue() {
		return hours;
	}

	public void setValue(int value) {
		this.hours = value;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "SUBMIT_DATE")
	public Date getSubmitDate() {
		return submitDate;
	}

	public void setSubmitDate(Date submitDate) {
		this.submitDate = submitDate;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
